package com.giga.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.giga.bean.User;
import com.giga.dao.UserDao;
import com.giga.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public List<User> selectUsers() {
        return userDao.selectList(null);
    }

    @Override
    public User selectUser(User user) {
        QueryWrapper<User> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("id",user.getId());
        queryWrapper.eq("name",user.getName());
        userDao.selectOne(queryWrapper);
        return user;
    }
}
